package co.yixiang.modules.system.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @author seven
 * @Package co.yixiang.modules.system.enums
 * @date 2020/9/1 10:35
 */
@Getter
@AllArgsConstructor
public enum UserRoleEnum {

    /**
     * 商户
     *
     * */
	MERCHANT("1","商户"),

    /**
     * 合伙人
     *
     * */
	PARTNER("2","合伙人");

    private String value;

    private String desc;

    public static UserRoleEnum toType(String value) {
        return Stream.of(UserRoleEnum.values())
                .filter(p -> p.value.equals(value))
                .findAny()
                .orElse(null);
    }
    public String value() {
        return this.value;
    }
}
